<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>angularJs条件表达式</title>
    <meta name="Copyright" content="All Rights Reserved"/>
    <link rel="shortcut icon" type="image/x-icon" href="itcast.ico"/>
    <link rel="stylesheet" type="text/css" href="base.css"/>
    <script src="js/angular.min.js"></script>
    <script type="text/javascript">
        /**
         * 定义模块
         */
        var myApp = angular.module("myApp",[]);

        /**
         * 给模块添加控制器
         */
        myApp.controller("myController",function ($scope) {
            /**
             * 定义对象
             */
            $scope.user = {age:17};
        })
    </script>
</head>
<!-- 指定AngularJS应用的根元素 -->
<body ng-app="myApp" ng-controller="myController">
<h2 ng-if="user.age<20">{{user.age}}</h2>
    <div>我可是最牛div层</div>
</body>
</html>